# $Id: PKGBUILD 88370 2013-04-16 20:03:40Z seblu $
# Maintainer: Sébastien Luttringer

pkgname=ipset
pkgver=6.18
pkgrel=1
pkgdesc='Administration tool for IP sets'
arch=('i686' 'x86_64')
url='http://ipset.netfilter.org'
license=('GPL2')
depends=('libmnl' 'bash')
backup=("etc/$pkgname.conf")
options=('!libtool')
source=("http://ipset.netfilter.org/$pkgname-$pkgver.tar.bz2"
        "$pkgname.systemd"
        "$pkgname.service")
md5sums=('776de6afe32ae386e6827a51c025464f'
         '7daa4f163eef9db216cb4c428e0342a3'
         'b032241b96b5802975fe4321cc511c6b')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-kmod=no
  make
}

package() {
  pushd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  # install doc
  install -dm755 "$pkgdir/usr/share/doc/$pkgname"
  install -m644 README UPGRADE ChangeLog "$pkgdir/usr/share/doc/$pkgname"
  # install pkgconfig file
  install -Dm644 lib/libipset.pc "$pkgdir/usr/lib/pkgconfig/libipset.pc"
  popd
  # systemd
  install -Dm 755 $pkgname.systemd \
    "$pkgdir/usr/lib/systemd/scripts/$pkgname"
  install -Dm 644 $pkgname.service \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"
  # default config file
  install -Dm 644 /dev/null "$pkgdir/etc/$pkgname.conf"
}

# vim:set ts=2 sw=2 et:
